#!/bin/bash

######################################################
# file : todo.
#   This script extracts all the lines tagged as [todo] from the diary.
#   It uses the perl search script to do this.
#
# Author : Anil Kainikara (anilkumar911@gmail.com)
#
# This code is licenced under the GPL.
#
######################################################

#sqlite3 /home/anil/.local/share/diary.db "select * from entries order by year,month,day"  |
#        awk ' BEGIN { datefound=0; date=""; content=0; prevdate="";}
#              /^[0-9][0-9][0-9][0-9]\|[0-9]+\|[0-9].*/ { datefound=1; if(content != 0){ print prevdate "\n----------"}; content=0;prevdate=$0}
#              $0 ~ /\[todo\]/ { content=1; print $0; }
#              $0 ~ /\[TODO\]/ { content=1; print $0; }
#              '

p2search -p '\[todo\]' | grep -v "##################################"
#p2search -p '\[todo\]' -p '\[ptodo\]' | grep -v "##################################"
